<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<%@include file="../blocks/header.jsp" %>



<div class="row">

    <%@include file="menu.jsp" %>

    <div class="span8">
        <c:if test="${empty user.doctor}">
        <h4>Вы не закреплены за врачем</h4>
        <c:if test="${error != null}">
            <div class="alert alert-error">
                <spring:message code="${error}" />
            </div>
        </c:if>
        <form action="/cabinet/connectToDoctor.do" method="POST">
            E-mail врача: <input type="text" name="emailDoctor" />  <br/>
            <button class="btn btn-large" type="submit">Указать</button>
        </form>
        </c:if>

        <c:if test="${user.doctor != null}">
            <table class="table table-hover">
                <tbody>
                <tr>
                    <th>ФИО</th>
                    <td>${user.doctor.fullName}</td>
                </tr>
                <tr>
                    <th>Контакты:</th>
                    <td>${user.doctor.email}, ${user.doctor.telephoneNumber}</td>
                </tr>
                <tr>
                    <th>адрес</th>
                    <td>${user.doctor.country}, ${user.doctor.state}, ${user.doctor.city}</td>
                </tr>
                <tr>
                    <th>Специализация</th>
                    <td>${user.specialization}</td>
                </tr>
                <tr>
                    <th>Медучреждение</th>
                    <td>${user.hospitalName}</td>
                </tr>
                <tr>
                    <th>Адрес медучреждения</th>
                    <td>${user.hospitalAdress}</td>
                </tr>
                </tbody>
            </table>
            <form action="/cabinet/resetConnectToDoctor.do" method="POST">
                <button class="btn btn-large" type="submit">Сменить врача</button>
            </form>
        </c:if>

    </div>

</div>



<%@include file="../blocks/footer.jsp" %>